//
//  ViewController.swift
//  YCNetworking
//
//  Created by YC on 2017/3/1.
//  Copyright © 2017年 YC. All rights reserved.
//

import UIKit
import Alamofire
import OurTools



class ViewController: UIViewController,YCAPIManagerParamSource, YCAPIManagerCallBackDelegate {
    
    private let apiManager = TestAPIManager()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        apiManager.paramSource = self
        apiManager.delegate = self
        _ = apiManager.loadData()
        
        LogRed("123")
        
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
    }
    
    func paramsForApi(_ manager: YCBaseAPIManager) -> Dictionary<String, Any> {
        let parameters = ["forced":"0",
                          "isAutoLogin":"0",
                          "name":"10622",
                          "password":"2wr9sBEogE6DVRcHG8fiLA==",
                          "tag":"614074524DAA40CAA144D5F96C4F07D5_2"]
        
        return parameters
    }
    
    func callAPIDidSuccess(in manager: YCBaseAPIManager) {
        if manager == self.apiManager {
//            NSLog("\(manager.fetchData(with: nil))")
        }
    }
    
    func callAPIDidFailed(in manager: YCBaseAPIManager) {
        if manager == self.apiManager {
//            NSLog("\(manager.fetchData(with: nil))")
        }
    }
}

